# Contributor: Matthias Ahouansou <matthias@ahouansou.cz>
# Maintainer: Matthias Ahouansou <matthias@ahouansou.cz>
pkgname=create-tauri-app
pkgver=4.5.7
pkgrel=0
pkgdesc="Build tool for Leptos"
url="https://tauri.app"
# loongarch64: blocked by libc crate
arch="all !s390x !loongarch64" # nix
license="MIT OR Apache-2.0"
makedepends="cargo-auditable"
depends="cargo"
subpackages="$pkgname-doc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/tauri-apps/create-tauri-app/archive/refs/tags/create-tauri-app-v$pkgver.tar.gz
"
options="net"
builddir="$srcdir/$pkgname-$pkgname-v$pkgver"

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm 755 target/release/cargo-create-tauri-app "$pkgdir"/usr/bin/cargo-create-tauri-app

	for l in _APACHE-2.0 _MIT .spdx
	do
		install -Dm 644 LICENSE"$l" "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE"$l"
	done
}

sha512sums="
e775cf987caf8026aa154db20af98d8ea45967ddfb89b6b452afdb5728558425e2b0ce4e4c589daeb02a4e650db1947004ea1a305165978e0e23d8b1fc0fa87e  create-tauri-app-4.5.7.tar.gz
"
